package com.mmy.service.impl.restaurant;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mmy.dao.restaurant.TRestaurantPlanRepository;
import com.mmy.domain.restaurant.TRestaurantPlan;
import com.mmy.service.restaurant.TRestaurantPlanService;

@Service
public class TRestaurantPlanServiceImpl implements TRestaurantPlanService {
	@Autowired
	TRestaurantPlanRepository tRestaurantPlanRepository;

	/**
	 * 获取计划单最大编码
	 * 
	 * @return 返回值说明 计划单编码
	 * @author 创建人 dingxd
	 * @date 创建日期 2020.11.16
	 */
	public String getMaxPlanID() {
		// 返回计划单最大编码
		Object objCode = tRestaurantPlanRepository.getMaxPlanID();
		String strPlanID = "";
		if (objCode != null) {
			strPlanID = objCode.toString();
		}
		return strPlanID;
	}

	/* 创建 */
	public void save(int planID) {
		// TODO Auto-generated method stub
		tRestaurantPlanRepository.save(planID);
	}

	/* 创建修改 */
	public void save(TRestaurantPlan tRestaurantPlan) {
		// TODO Auto-generated method stub
		tRestaurantPlanRepository.save(tRestaurantPlan);
	}

	/* 通过ID查找 */
	public TRestaurantPlan findByPlanID(int planID) {
		// TODO Auto-generated method stub
		return tRestaurantPlanRepository.findByPlanID(planID);
	}

	/* 删除 */
	public void delRestaurantPlan(List<Integer> lstPlanID) {
		// TODO Auto-generated method stub
		tRestaurantPlanRepository.delRestaurantPlan(lstPlanID);
	}

}
